﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Drawing;

public partial class Draw : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int width = 400, hight = 250;
        Bitmap bitmap = new Bitmap(width, hight);
        Graphics g = Graphics.FromImage(bitmap);
        try
        {
            g.Clear(Color.YellowGreen);

            Pen p1 = new Pen(Color.Blue);
            Pen p2 = new Pen(Color.Yellow, 10);

            SolidBrush brush1 = new SolidBrush(Color.Blue);
            SolidBrush brush2 = new SolidBrush(Color.Yellow);
            Pen p3 = new Pen(brush1);
            Pen p4 = new Pen(brush2);

            g.DrawLine(p1, 10, 10, 200, 10);
            g.DrawLine(p2, 10, 60, 200, 60);
            g.DrawLine(p3, 10, 110, 200, 110);
            g.DrawLine(p4, 10, 160, 200, 160);

            System.IO.MemoryStream ms = new System.IO.MemoryStream();
            bitmap.Save(ms,System.Drawing.Imaging.ImageFormat.Gif);
            Response.ClearContent();
            Response.ContentType = ("image/Gif");
            Response.BinaryWrite(ms.ToArray());

        }
        catch(Exception ms)
        {
            Response.Write(ms.Message);
        }
     
    }
}